//user 模块
//声明 4 个配置项
const state = {
    userInfo:{
        name: 'zs',
        age: 19
    },
    score: 20,

}
const mutations = {
    upDataMsg(state,newUserinfo){
        state.userInfo=newUserinfo
    }
}
const actions = {}
const getters = {
    //分模块后 state 是 子模块的state
    UpName(state){
        return state.userInfo.name.toUpperCase()
    }
}
//导出
export default {
    //开启命名空间
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}